<?php
class test{
    public $a = 1;
    private $b = 2;
    public function __get($name){
         return $this->$name.' is private Variable';
    }
}
$d=new test();
echo $d->a;
echo $d->b;
?>